<template>
  <ul class="todo-list">
    <!-- completed: 完成的类名 -->
    <li class="completed" v-for="(item, index) in arr" :key="index">
      <div class="view">
        <input class="toggle" type="checkbox" />
        <label>{{ arr[index].title }}</label>
        <button class="destroy" @click="btnDel(item.id)"></button>
      </div>
    </li>
  </ul>
</template>

<script>
export default {
  data () {
    return {}
  },
  props: ['arr'],
  methods: {
    btnDel (id) {
      this.$emit('btn-del', id)
    }

    // this.$emit('btn-add', this.item.id)
    // console.log(this.item.id)
  }
}
</script>
